<div id="openingOrder">
    <div id="projectList">
        <div id="projectListBox">
            <div class="original">
                <div class="projectListTitle">
                    <div style="flex: 1">牙位</div>
                    <div style="flex: 2">项目名称</div>
                    <div>单价</div>
                    <div>单位</div>
                    <div>数量</div>
                    <div>折后金额</div>
                    <div>折扣(100%)</div>
                    <div style="display: none">实收金额</div>
                    <div>医生</div>
                </div>
                <div id="projectListInfo" class="singleBox">
                    @for(dealInfo in dealInfoList){
                    <div class="proDealInfo">
                        <div id="22toothBox" class="toothBox"
                             style="display: flex;flex-direction: column;flex: 1;height: 24px;">
                            <input class="id" type="hidden" value="${dealInfo.id}"/>
                            <div style="flex: 1;display: flex;border-bottom: 1px solid #999999">
                                <div id="22toothBox1" class="leftUp"
                                     style="flex: 1;border-right: 1px solid #999999;line-height: 11px;">
                                    ${dealInfo.leftUp}
                                </div>
                                <div id="22toothBox2" class="leftDown" style="flex: 1;line-height: 11px;">
                                    ${dealInfo.leftDown}
                                </div>
                            </div>
                            <div style="flex: 1;display: flex">
                                <div id="22toothBox3" class="rightUp"
                                     style="flex: 1;border-right: 1px solid #999999;line-height: 11px;">
                                    ${dealInfo.rightUp}
                                </div>
                                <div id="22toothBox4" class="rightDown" style="flex: 1;line-height: 11px;">
                                    ${dealInfo.rightDown}
                                </div>
                            </div>
                        </div>
                        <div style="flex: 2;">
                                <span class="payServiceName">${dealInfo.payServiceName}
                                    <span><input class="payServiceId" value="${dealInfo.payServiceId}"
                                                 type="hidden"></span>
                                </span>
                        </div>
                        <div>
                            <input style="text-align: right"  readonly="readonly"
                                   type="text" class="payService" name="payService" value="${dealInfo.payService}">
                            <input type="hidden" class="discountHide" value="${dealInfo.payService}">
                            <input class="unitPrice" value="${dealInfo.payServicePriceTwo}" type="hidden">
                            <input class="unitPriceOne" value="${dealInfo.payServicePriceOne}" type="hidden"/>
                            <input class="unitPriceTwo" value="${dealInfo.payServicePriceTwo}" type="hidden"/>
                            <input class="priceRecord" value="${dealInfo.discountHide}" type="hidden"/>
                            <input class="priceDiscountRecord" value="${dealInfo.orderDiscount}" type="hidden"/>
                            <input type="hidden" class="primary" value="${dealInfo.primaryAmount}">元
                        </div>
                        <div>
                            <span>${dealInfo.unit}</span>
                        </div>
                        <div>
                            <input class="num" style="width:35px;text-align: right;vertical-align: top;"
                                   readonly="readonly" value="${dealInfo.payServiceNum}">
                        </div>
                        <div>
                            <input  readonly="readonly"  class="amount"
                                   style="text-align: right" value="${dealInfo.foldingPay}" type="text">
                        </div>
                        <div>
                            <input  readonly="readonly" style="text-align: right;" class="discount"
                                   value="${dealInfo.orderDiscount}" type="text"/>
                        </div>
                        <div>
                            <select disabled="disabled" class="doctor" style="width: 90%;">
                                @for(doctor in docList){
                                @if(dealInfo.doctor == doctor.doctor){
                                <option selected="selected" value="${doctor.doctor}">${doctor.doctor}</option>
                                @}
                                @if(dealInfo.doctor != doctor.doctor){
                                <option value="${doctor.doctor}">${doctor.doctor}</option>
                                @}
                                @}
                            </select>
                        </div>
                    </div>
                    @}
                </div>
                <div class="discountBox">
                    <div>
                        <div>
                            <span>整体折扣(%)</span>
                            <input id="totalDiscount" readonly="readonly" value="${totalDiscount}" type="text"/>
                        </div>
                    </div>
                    <div style="text-align: right">

                        <div>
                            <span>原价</span>
                            <input id="originalPrice" type="text" value="${originalPrice}" readonly="readonly"/>
                        </div>
                        <div>
                            <span style="color: #FF7E00">折后金额</span>
                            <input id="totalSum1" type="text" value="${totalSum1}" readonly="readonly"/>
                        </div>
                    </div>
                </div>
            </div>

            <div class="integralBox">
                @if(isDeduction=="1"&&isDeposit=="1"){
                <label for="integral"><input disabled="disabled" type="checkbox" checked="checked" name="discount"
                                             id="integral" value="使用返现"><span>使用返现抵扣金额<span id="jfbalance"
                                                                                        style="margin-left: 10px;">
                    ${jfbalance}</span></span></label>
                <label for="earnest"><input disabled="disabled" type="checkbox" checked="checked" name="discount"
                                            id="earnest" value="储值划扣"><span>储值余额<span id="moneyBalance"
                                                                                      style="margin-left: 10px;">
                    ${moneyBalance}</span></span></label>
                @}
                @if(isDeduction == "0"&&isDeposit=="1"){
                <label for="integral"><input disabled="disabled" type="checkbox" name="discount" id="integral"
                                             value="使用返现"><span>使用返现余额<span style="margin-left: 10px;">0.00</span></span></label>
                <label for="earnest"><input disabled="disabled" type="checkbox" checked="checked" name="discount"
                                            id="earnest" value="储值划扣"><span>储值余额<span
                        style="margin-left: 10px;">0.00</span></span></label>
                @}
                @if(isDeduction == "1"&&isDeposit == "0"){
                <label for="integral"><input disabled="disabled" type="checkbox" checked="checked" name="discount"
                                             id="integral" value="使用返现"><span>使用返现余额<span
                        style="margin-left: 10px;">0.00</span></span></label>
                <label for="earnest"><input disabled="disabled" type="checkbox" name="discount" id="earnest"
                                            value="储值划扣"><span>储值余额<span
                        style="margin-left: 10px;">0.00</span></span></label>
                @}
                @if(isDeduction == "0"&&isDeposit == "0"){
                <label for="integral"><input disabled="disabled" type="checkbox" name="discount" id="integral"
                                             value="使用返现"><span>使用返现余额<span style="margin-left: 10px;">0.00</span></span></label>
                <label for="earnest"><input disabled="disabled" type="checkbox" name="discount" id="earnest"
                                            value="储值划扣"><span>储值余额<span
                        style="margin-left: 10px;">0.00</span></span></label>
                @}
            </div>

            <div id="isDepositAndIsDeposit" class="original projectBox">
                <div>
                    <div class="projectListTitle">
                        <div style="flex: 2">项目名称</div>
                        <div style="flex: 0.5">单价</div>
                        <div style="flex: 0.5">数量</div>
                        <div style="flex: 0.5">折后价</div>
                        <div style="flex: 0.5">实收</div>
                        <div class="earnest isDeposit">划扣储值</div>
                        <div class="integral isDeduction">抵用方式</div>
                        <div class="integral isDeduction">抵用金额</div>
                    </div>
                    <div id="discountBox" class="singleBox">
                        @for(dealInfo in dealInfoList){
                        <div class="deductionDealList">
                            <input class="id" value="${dealInfo.id}" type="hidden">
                            <div class="payServiceName" style="flex: 2">${dealInfo.payServiceName}
                                <input readonly="readonly" class="payServiceId" value="${dealInfo.payServiceId}"
                                       type="hidden">
                            </div>
                            <div class="payService" style="flex: 0.5">${dealInfo.payService}
                                <input value="${dealInfo.leftUp}" class="leftUp" type="hidden">
                                <input value="${dealInfo.leftDown}" class="leftDown" type="hidden">
                                <input value="${dealInfo.rightUp}" class="rightUp" type="hidden">
                                <input value="${dealInfo.rightDown}" class="rightDown" type="hidden">
                            </div>
                            <div class="num" style="flex: 0.5">${dealInfo.payServiceNum}</div>
                            <div style="display: none;">
                                <input class="discountHide" value="${dealInfo.payService}" type="hidden">
                                <input class="primary" value="${dealInfo.primaryAmount}" type="hidden">
                                <input class="doctor" value="${dealInfo.doctor}" type="hidden">
                            </div>
                            <div class="amount" style="flex: 0.5">${dealInfo.foldingPay}</div>
                            <div class="realAmount" style="flex: 0.5">${dealInfo.serviceActualPay}</div>
                            <div class='isDeposit'><input readonly="readonly" class="depositAmount"
                                                          value="${dealInfo.depositAmount}"
                                                          oninput="value=value.replace(/[^\d]/g,''),onchangeDepositAmount(this)"
                                                          type="text"></div>
                            <div class='isDeduction'>
                                <select disabled="disabled" class="deductionType" name="1">
                                    @for(checkoutMethod in checkoutMethodList){
                                    @if(dealInfo.deductionType ==checkoutMethod.id){
                                    <option selected="selected" value="${checkoutMethod.id}">
                                        ${checkoutMethod.checkoutMethod}
                                    </option>
                                    @}
                                    @if(dealInfo.deductionType !=checkoutMethod.id){
                                    <option value="${checkoutMethod.id}">${checkoutMethod.checkoutMethod}</option>
                                    @}
                                    @}
                                </select>
                            </div>
                            <div class='isDeduction'>
                                <input class="deductionAmount" value="${dealInfo.deductionAmount}"
                                       onkeyup="this.value=this.value.replace(/\D/g,&quot;&quot;)"
                                       onafterpaste="this.value=this.value.replace(/\D/g,&quot;&quot;)"
                                       oninput="changeDeductionAmount(this)" type="text">
                            </div>
                        </div>
                        @}
                    </div>
                </div>
                <div class="discountBox discountBoxHide">
                    <div style="text-align: right">
                        <div>
                            <span style="color: #FF7E00">本次应收</span>
                            <input readonly="readonly" id="realTotalSum2" type="text" value="${newTotalSum}"/>
                        </div>
                    </div>
                </div>
            </div>

            <div class="chargeBox">
                <div>
                    <span>应收：</span>
                    <input type="text" readonly="readonly" id="newTotalSum" value="${newTotalSum}">
                </div>
                <div>
                    <span>缴费：</span>
                    <input type="text" readonly="readonly" oninput="oninputPayAmount()" id="newPayAmount"
                           style="background: white;color: #ff7e00;" value="${realTotalSum}">
                </div>
                <div>
                    <span>欠费：</span>
                    <input type="text" readonly="readonly" style="color: red;" value="${totalArrears}" id="newArrears">
                </div>
            </div>

            <div class="personnelBox">
                <div>
                    <span style="vertical-align: top;">备注 ：</span>
                    <textarea name="proRemark" id="proRemark" readonly="readonly"></textarea>
                </div>
            </div>
            <div class="submissionBox">
                <div class="btnBox">
                    <button id="cancel" onclick="parent.layer.close(parent.layer.getFrameIndex(window.name))"
                            type="button" class="btn">取消
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
@layout("/common/_noneBox.html"){
@}